//
// Created by jiangpenghui on 2023/6/16.
//

#include "task_thread.h"
#include <thread>

#include<chrono>
#include <random>
#include <iostream>
#include <list>

using namespace std;

int do_something(char c) {
    default_random_engine drc(c);
    uniform_int_distribution<int> id(10, 500);
    for (int i = 0; i < 10; ++i) {
        //休眠当前线程
        this_thread::sleep_for(chrono::milliseconds(id(drc)));
        cout.put(c).flush();
    }
    return c;
}

int func1() {
    return do_something('.');
}

int func2() {
    return do_something('+');
}

void task_1() {
    list<int> v;
    while (true) {
        for (int i = 0; i < 1000000; ++i)
            v.push_back(i * 2);
    }
    cout.put('.').flush();
}
